import com.alibaba.excel.EasyExcel;
import com.excel.listener.EmpParseListener;
import com.excel.pojo.Emp;

import java.util.ArrayList;
import java.util.List;

public class ExcelWriteDemo {
    public static void main(String[] args) {
        EasyExcel.write("D:/1.xls",Emp.class).sheet("第一个表格").doWrite(getData());
    }

    public static List<Emp> getData(){
        List<Emp> empList = new ArrayList<Emp>();
        empList.add(new Emp(1,"Tom1",10,"男","测试数据111"));
        empList.add(new Emp(2,"Tom2",11,"男","测试数据222"));
        empList.add(new Emp(3,"Tom3",12,"男","测试数据333"));
        empList.add(new Emp(4,"Tom4",13,"男","测试数据444"));
        empList.add(new Emp(5,"Tom5",14,"男","测试数据555"));
        empList.add(new Emp(6,"Tom6",15,"男","测试数据666"));

        return empList;
    }
}